package com.pro.system.Repository;

import com.pro.system.entity.Movie;
import com.pro.system.entity.Pay;
import com.pro.system.entity.Purchase;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

@Repository
public interface PurchaseRepository extends JpaRepository<Purchase,Integer> {
    @Override
    List<Purchase> findAll();

    @Modifying
    @Transactional
    @Query(value = "select * from purchase where news like %?1% " ,nativeQuery = true)
    public List<Purchase> findByNameLike(String name);
}
